package com.jobinsight.util;

public enum NodeType {
	OBJ, OBJ_PRIM ,FIELD ,ITERABLE ,MAP ,
	FINALIZE_OBJ , FINALIZE_OBJ_PRIM , FINALIZE_FIELD , FINALIZE_ITERABLE , FINALIZE_MAP;

	public static NodeType getType(Object theObject){
		return getType( theObject, false );
	}
	
	public static NodeType getType(Object theObject, boolean ftype){
		ObjectType ot = ObjectType.getType(theObject);
		switch (ot) {
			case ITERABLE:
				return ftype?NodeType.FINALIZE_ITERABLE:NodeType.ITERABLE;
			case MAP:
				return ftype?NodeType.FINALIZE_ITERABLE:NodeType.ITERABLE;
			case OBJ_PRIM:
				return ftype?NodeType.FINALIZE_OBJ_PRIM:NodeType.OBJ_PRIM;
			default:
				return ftype?NodeType.FINALIZE_OBJ:NodeType.OBJ;
		}
	}
}
